package  {
	import flash.display.Sprite;
	import flash.events.Event;
	import mdm.Application;
 	
	/**
	 * ...
	 * @author Ricardo Teixeira
	 */
	public class AbsZincApp extends Sprite {
		
		private static var _INITIALIZED:Boolean = false;
		
		public function AbsZincApp () {
			if (stage) {
				this.onInit();
			} else {
				this.addEventListener(Event.ADDED_TO_STAGE, onInit);
			}
		}
		
		protected function onInit(e:Event = null):void {
			removeEventListener(Event.ADDED_TO_STAGE, onInit);
			// entry point
			 
			try {
				mdm.Application.init(this, onMDMinit);
			} catch (e:Error) {
				trace ("# inicializando");
			}
		}
		
		/**
		 * Evento de inicialização do mdm. Deve ser sobreescrito.
		 */
		protected function onMDMinit():void {			
			AbsZincApp._INITIALIZED = true;
	 	}
		
		static public function get INITIALIZED():Boolean { return _INITIALIZED; }
		
	}

}